﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common.Utilities.DLR
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class MethodArgument
    {
        private string _ArgName;
        /// <summary></summary>
        public string ArgName
        {
            get { return _ArgName; }
            set { _ArgName = value; }
        }

        private Type _ArgType;
        /// <summary></summary>
        public Type ArgType
        {
            get { return _ArgType; }
            set { _ArgType = value; }
        }

        private object _ArgValue;
        /// <summary></summary>
        public object ArgValue
        {
            get { return _ArgValue; }
            set { _ArgValue = value; }
        }

        private bool _PassByRef;
        /// <summary></summary>
        public bool PassByReference
        {
            get { return _PassByRef; }
            set { _PassByRef = value; }
        }

        /// <summary></summary>
        public MethodArgument(string argName, Type argType, bool isRef)
        {
            this._ArgName = argName;
            this._ArgType = argType;
            this._ArgValue = null;
            this._PassByRef = isRef;
        }

        /// <summary></summary>
        public MethodArgument(string argName, Type argType, bool isRef, object argValue)
        {
            this._ArgName = argName;
            this._ArgType = argType;
            this._ArgValue = argValue;
            this._PassByRef = isRef;
        }

        /// <summary></summary>
        public MethodArgument()
        {
            this._ArgName = string.Empty;
            this._ArgType = Type.Missing.GetType();
            this._ArgValue = null;
            this._PassByRef = false;
        }
        /// <summary></summary>
        public bool IsVoidArg
        {
            get
            {
                if (string.IsNullOrEmpty(this._ArgName))
                    return true;
                else
                    return false;
            }
        }
    }
}
